package com.zyh.homework.test1.bean;

public class Rectangle {
    private double chang;
    private double kuan;

    public Rectangle() {
    }

    public Rectangle(double chang, double kuan) {
        this.chang = chang;
        this.kuan = kuan;
    }

    public double getChang() {
        return chang;
    }

    public void setChang(double chang) {
        this.chang = chang;
    }

    public double getKuan() {
        return kuan;
    }

    public void setKuan(double kuan) {
        this.kuan = kuan;
    }

//    方法
    public double getArea(){
        return (chang+kuan)*2;
    }
    public double getPerimeter(){
        return chang*kuan;
    }
    public void getInfo(){
        System.out.println("长："+chang+"宽："+kuan+"面积："+chang*kuan+"周长："+(chang+kuan)*2);
    }

}
